package com.bert.generator;


import cn.hutool.core.date.StopWatch;
import com.bert.generator.base.GenerateJavaCode;
import com.bert.generator.base.GenerateWebCode;
import com.bert.generator.base.GeneratorConfig;

import static java.util.concurrent.TimeUnit.MILLISECONDS;

/**
 * 代码生成运行类
 */
public class GeneratorRun {

    public static void main(String[] args) {
        StopWatch stopWatch = new StopWatch();
        stopWatch.start("1");
        GeneratorConfig generatorConfig = new GeneratorConfig("bert",
                "root","123456","127.0.0.1",3306,
                "D:/code/generator","xxl_job");
        generatorConfig.addPrefix("xxl","cockpit")
                .addBizPackageName("cockpit","at_user1","at_user2","at_user3");
        // 执行Java代码生成
        new GenerateJavaCode(generatorConfig).generate();
//
//        // 执行Web代码生成
//        new GenerateWebCode(generatorConfig).generate();

//        GeneratorConfig generatorConfig =
//                new GeneratorConfig("hkbt", "root", "Hkbt@1234", "10.100.22.220", 3313, "D:/code/generator2", "hiksxjq")
//                        .addPrefix("wl_", "cockpit")
//                        .addPrefix("ts_", "cockpit")
//                        .addPrefix("vs_", "cockpit")
//                        .addBizPackageName("wetland","wl_animal_plant_region_plan")
////                .addBizPackageName("touristService", "ts_basic_service_measures","ts_comprehensive_consumption","ts_popular_attractions","ts_popularity","ts_route_guide",
////                                                                "ts_viewing_value")
//                        .addBizPackageName("visitorSupervision", "vs_tourism_area","vs_tourism_area_file");
//        generatorConfig.addOnlyNeedTableNames("wl_animal_plant_region_plan", "vs_tourism_area", "vs_tourism_area_file");
//        new GenerateJavaCode(generatorConfig).generate();
        stopWatch.stop();
        System.out.println(stopWatch.prettyPrint(MILLISECONDS));
    }
}
